Dashboard Temp Share Shortlinks Frames API

HTMLify

app.js
Views: 10 | Author: huxn-webdev
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
let btns = document.querySelectorAll(".btn");
let banner = document.getElementById("banner");

btns.forEach((btn, index) => {
  btn.addEventListener("click", () => {
    banner.src = `images/${index}.jpg`;
    animation();
    btn.classList.add("active");
  });
});

function animation() {
  banner.classList.add("zoom");

  setTimeout(() => {
    banner.classList.remove("zoom");
  }, 1000);

  for (b of btns) {
    b.classList.remove("active");
  }
}